from lib.files import ReadFileData


class Elements:

    def __init__(self, data):
        self._data = data

    def __getitem__(self, item):
        data = self._data.get(item)
        if data and "=" in data:
            return data.split("=")


def read_page_elements(path) -> Elements:
    data = ReadFileData(path)
    if data.data:
        return Elements(data=data.data)
